<!--
var searchConditionPane = null
var searchConditionType = null;
var searchCondition  = null;
var searchConditions = null;
function initSearchPane(){
	searchConditionPane = $("searchConditionPane");
	searchConditionType = $("searchConditionType");
	searchCondition = $("searchCondition");
	searchConditions = new Array();
	if(searchConditionType!=null){
		var options = searchConditionType.options;
		for(var i=0;i<options.length;i+=1){
			var cons = new Array();
			cons[0] = options[i].value;
			cons[1] = options[i].text;
			cons[2] = false;
			cons[3] = null;
			searchConditions[searchConditions.length] = cons;
		}
	}
}
function refreshSearchPane(){
	var strHTML = "";
	for(var i=0;i<searchConditions.length;i+=1){
		if(searchConditions[i][2]){
			strHTML += "<span class=\"search_conditon\">";
			strHTML += searchConditions[i][1];
			strHTML += "：<font color=\"#4080ff\">";
			strHTML += searchConditions[i][3];
			strHTML += "</font><span class=\"search_conditon_close\" onmouseover=\"closeIconOverBg(this);\" onmouseout=\"closeIconOutBg(this);\" onclick=\"removeCondition(" + i;
			strHTML += ")\"></span><input type=\"hidden\" name=\"searchConditons\" value=\"";
			strHTML += searchConditions[i][0]+":"+searchConditions[i][3];
			strHTML += "\" /></span>";
		}
	}
	searchConditionPane.innerHTML = strHTML;
}
function addCondition(value,typeIndex){
	if(value==null){
		value = searchCondition.value;
	}
	if(value.length!=0){
		if(typeIndex==null){
			typeIndex = getSelectedOption(searchConditionType);
		}
		if(typeIndex!=-1){
			var options = searchConditionType.options;
			options.remove(typeIndex);
			if(options.length==0){
				searchConditionType.disabled = true;
			}
			for(var i=0;i<=typeIndex;i+=1){
				if(searchConditions[i][2]){
					typeIndex+=1;
				}
			}
			searchConditions[typeIndex][2] = true;
			searchConditions[typeIndex][3] = value;
			refreshSearchPane();
		}
		searchCondition.value = "";
	}
}
function removeCondition(typeIndex){
	var options = searchConditionType.options;
	if(options.length==0){
		searchConditionType.disabled = false;
	}
	searchConditions[typeIndex][2] = false;
	searchConditions[typeIndex][3] = null;
	options.length = 0;
	for(var i=0;i<searchConditions.length;i+=1){
    	if(!searchConditions[i][2]){
    		var optionObj = document.createElement("OPTION");
        	optionObj.value = searchConditions[i][0];
        	optionObj.text = searchConditions[i][1];
        	options[options.length] = optionObj;
    	}
    }
	refreshSearchPane();
}
function getSelectedOption(selectObj){
	if(selectObj!=null){
		var options = selectObj.options;
		for(var i=0;i<options.length;i+=1){
			if(options[i].selected==true){
				return i;
			}
		}
	}
	return -1;
}
windowEvents.addEvent("load",initSearchPane);
windowEvents.enableEvent("load");
function closeIconOverBg(closeObj){
	if(closeObj!=null){
		closeObj.style.backgroundImage = "url('img/closeicon_small_on.png')";
	}
}
function closeIconOutBg(closeObj){
	if(closeObj!=null){
		closeObj.style.backgroundImage = "url('img/closeicon_small.png')";
	}
}
//-->